<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>auth</title>
</head>
<body>
<h3>欢迎来到{{ action }}页面</h3>
<form action="" method="post">
    {% csrf_token %}
    <input type="text" placeholder="user" name="username">
    <input type="text" placeholder="password" name="password">
    <input type="submit" value="提交"><span style="color: red;" id="msg">{{ msg }}</span>
</form>
{% if action == "登录" %}
    不是注册用户?<a href="{% url 'register' %}">点我</a>进行注册
{% else %}
    已注册?<a href="{% url 'login' %}">点我</a>登录
{% endif %}

<script>
    setInterval(function () {
        document.getElementById('msg').innerText = "";
    }, 4000)
</script>
</body>
</html>